#include<stdio.h>
main()
{
 	  int m,n,k,j;
 	  system("cls");
 	  printf("Input the row number and the number:");
 	  fflush(stdin);
	   scanf("%d%d",&n,&m);
	   for(k=0;k<n;k++){
	   					for(j=k*(m/n)+1;j<=j+(m/n)&&j<=m;j++){
	   					printf("%d",j);}
	   					printf("\n");
						}
						getch();
						return 0;
						}
